package org.caowei.samples.model;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "exam_user")
public class User implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="user_id",nullable = false)
	private String userId;
	
	@OneToMany(mappedBy = "user")
	private Set<UserSubject> UserSubject;
	
	@OneToMany(mappedBy = "User3")
	private Set<ExamUserRole> ExamUserRole;
	
	@Column(name="user_name")
	private String userName;
	
	@Column(name="password")
	private String password;
	
	@Column(name="tel")
	private String tel;
	
	@Column(name="email")
	private String email;
	
	@Column(name="address")
	private String address;

	@Column(name="birthday")
	private Date birthday;
	
	@Column(name="gender")
	private Integer gender;

	@Column(name="last_lock_time")
	private Date lastLockTime;
	
	@Column(name="login_fail_count")
	private Integer loginFailCount;

	

	public User(String userId, Set<org.caowei.samples.model.UserSubject> userSubject,
			Set<org.caowei.samples.model.ExamUserRole> examUserRole, String userName, String password, String tel,
			String email, String address, Date birthday, Integer gender, Date lastLockTime, Integer loginFailCount) {
		super();
		this.userId = userId;
		UserSubject = userSubject;
		ExamUserRole = examUserRole;
		this.userName = userName;
		this.password = password;
		this.tel = tel;
		this.email = email;
		this.address = address;
		this.birthday = birthday;
		this.gender = gender;
		this.lastLockTime = lastLockTime;
		this.loginFailCount = loginFailCount;
	}

	public Set<UserSubject> getUserSubject() {
		return UserSubject;
	}

	public void setUserSubject(Set<UserSubject> userSubject) {
		UserSubject = userSubject;
	}

	public User() {
		super();
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String id) {
		this.userId = id;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getTel() {
		return tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	public Integer getGender() {
		return gender;
	}

	public void setGender(Integer gender) {
		this.gender = gender;
	}

	public Date getLastLockTime() {
		return lastLockTime;
	}

	public void setLastLockTime(Date lastLockTime) {
		this.lastLockTime = lastLockTime;
	}

	public Integer getLoginFailCount() {
		return loginFailCount;
	}

	public void setLoginFailCount(Integer loginFailCount) {
		this.loginFailCount = loginFailCount;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

}
